/*全局静态数据,公用*/

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class Global {
  //全局公共GlobalKey
  static GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();

  //全局tabbarKey
  static GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();

 //全局聊天消息数量
 static int count = 0 ;

 //是否在聊天页面
  static bool  isChat = false ;


  static double get pixelRatio =>
      WidgetsBinding.instance.window.devicePixelRatio;

  /// 初始化
  static Future init() async {
    WidgetsFlutterBinding.ensureInitialized();
    //设置禁止横屏
    SystemChrome.setPreferredOrientations([
      DeviceOrientation.portraitUp,
      DeviceOrientation.portraitDown,
    ]);
  }
}
